﻿using HAVNet.Core.String;
using System.Collections.Generic;


namespace HAVNet.Intros.AST
{
    public class ASTTypeNameParts : List<ASTTypeNamePart>
    {
        public override string ToString ()
        {
            return Strings.joinobjs (".", this);
        }
    }

    public class ASTTypeNamePart : ASTNode
    {
        public readonly string               ident;
        public readonly ASTTypeArgumentList  typeArgumentList;

        public ASTTypeNamePart (string ident, ASTTypeArgumentList typeArgumentList)
        {
            this.ident              = ident;
            this.typeArgumentList   = typeArgumentList;
        }

        public override string ToString()
        {
            // ej:     Pipo<T,U,V>

            string ret = ident;

            if (typeArgumentList != null)
                ret += typeArgumentList.ToString();

            return ret;
        }
    }
}
